import axios from '@/utils/request'
export const getAddressList = () => {
  return axios.get('/address/list')
}
export const getAddressDefaultId = () => {
  return axios.get('/address/defaultId')
}
export const getregiontree = () => {
  return axios.get('/region/tree')
}
export const addaddress = (name, phone, region, detail) => {
  return axios.post('/address/add', {
    form: {
      name,
      phone,
      region,
      detail
    }
  })
}
export const setDefault = (addressId) => {
  return axios.post('/address/setDefault', {
    addressId
  })
}
export const editAddress = (addressId, name, phone, region, detail) => {
  return axios.post('/address/edit', {
    addressId,
    form: {
      name,
      phone,
      region,
      detail
    }
  })
}
export const removeAddress = (addressId) => {
  return axios.post('/address/remove', {
    addressId
  })
}
